<template>
  <div>
    <el-menu
      :default-active="active"
      mode="horizontal"
      active-text-color="#ec4141"
      router
    >
      <el-menu-item index="1" route="/pageTwo/videoRec">视频</el-menu-item>
      <el-menu-item index="2" route="/pageTwo/mvRec">MV</el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: '1',
    };
  },
  mounted() {
    this.ifPath();
  },
  methods: {
    ifPath() {
      if (this.$route.path === '/pageTwo/videoRec') {
        this.active = '1';
      } else if (this.$route.path === '/pageTwo/mvRec') {
        this.active = '2';
      }
    },
  },
};
</script>

<style>
</style>
